package com.itheima.job;

import java.math.BigDecimal;

public class Test1 {
    public static void main(String[] args) {
        String[] nums = {"3.22","8.1","7","2.5","3.1","7.77","8.0","9.21"};
        BigDecimal bd1 = new BigDecimal("0");
        for (int i = 0; i < nums.length; i++) {
            BigDecimal num = new BigDecimal(nums[i]);
            bd1 = bd1.add(num);
        }
        BigDecimal divide = bd1.divide(new BigDecimal(nums.length), 2, BigDecimal.ROUND_HALF_UP);
        System.out.println(divide);
    }
}
